package com.nai365.nart.member.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nai365.nart.member.entity.UserBank;
import com.nai365.nart.member.mapper.UserBankMapper;
import com.nai365.nart.member.service.UserBankService;
import org.springframework.stereotype.Service;

@Service
public class UserBankServiceImpl extends ServiceImpl<UserBankMapper, UserBank> implements UserBankService {
	@Override
	public Boolean saveUserBank(UserBank userBank) {
		return this.save(userBank);
	}

	@Override
	public UserBank findUserBankByUserId(Long userId) {
		LambdaQueryWrapper<UserBank> userBankLambdaQueryWrapper = new LambdaQueryWrapper<>();
		userBankLambdaQueryWrapper.eq(UserBank::getUserId,userId);
		return this.getOne(userBankLambdaQueryWrapper);
	}

	@Override
	public Boolean updateUserBank(UserBank userBank) {

		return this.saveOrUpdate(userBank);
	}
}
